function deleteMenu(menuId) {
    return new Promise((resolve, reject) => {
        axios({
            method: 'delete',
            url: '/amc/sys/base/menu/delete/'+menuId,
            baseURL: 'http://127.0.0.1:8098',
            headers: {'authorization': layui.data('user').token}
        }).then((response)=>{
            let back = response.data
            resolve(back)
        }).catch(reason => {
            reject(reason)
        })
    });
}

function saveMenu(menuInfo) {
    return new Promise((resolve, reject) => {
        axios({
            method: 'post',
            url: '/amc/sys/base/menu/save',
            baseURL: 'http://127.0.0.1:8098',
            headers: {'authorization': layui.data('user').token},
            data: menuInfo
        }).then((response)=>{
            let back = response.data
            resolve(back)
        }).catch(reason => {
            reject(reason)
        })
    });
}

function updateMenu(menuInfo) {
    return new Promise((resolve, reject) => {
        axios({
            method: 'put',
            url: '/amc/sys/base/menu/update',
            baseURL: 'http://127.0.0.1:8098',
            headers: {'authorization': layui.data('user').token},
            data: menuInfo
        }).then((response)=>{
            let back = response.data
            resolve(back)
        }).catch(reason => {
            reject(reason)
        })
    });
}

function saveFunc(funcInfo) {
    return new Promise((resolve, reject) => {
        axios({
            method: 'post',
            url: '/amc/sys/base/menu/func/save',
            baseURL: 'http://127.0.0.1:8098',
            headers: {'authorization': layui.data('user').token},
            data: funcInfo
        }).then((response)=>{
            let back = response.data
            resolve(back)
        }).catch(reason => {
            reject(reason)
        })
    });
}

function updateFunc(funcInfo) {
    return new Promise((resolve, reject) => {
        axios({
            method: 'put',
            url: '/amc/sys/base/menu/func/update',
            baseURL: 'http://127.0.0.1:8098',
            headers: {'authorization': layui.data('user').token},
            data: funcInfo
        }).then((response)=>{
            let back = response.data
            resolve(back)
        }).catch(reason => {
            reject(reason)
        })
    });
}

function deleteFunc(funcId) {
    return new Promise((resolve, reject) => {
        axios({
            method: 'delete',
            url: '/amc/sys/base/menu/func/delete/'+funcId,
            baseURL: 'http://127.0.0.1:8098',
            headers: {'authorization': layui.data('user').token}
        }).then((response)=>{
            let back = response.data
            resolve(back)
        }).catch(reason => {
            reject(reason)
        })
    });
}

function searchMenus(proMark) {
    return new Promise((resolve, reject) => {
        axios({
            method: 'get',
            url: '/amc/sys/base/menu/search/by/'+proMark,
            baseURL: 'http://127.0.0.1:8098',
            headers: {'authorization': layui.data('user').token}
        }).then((response)=>{
            let back = response.data
            resolve(back)
        }).catch(reason => {
            reject(reason)
        })
    });
}